// 页面路径：store/index.js
// import { createApp } from 'vue'
import { createStore } from 'vuex'  
const store = createStore({
	state:{//存放状态
		"username":"foo",
		"age":18, 
		user:uni.getStorageSync('userInfo'),
		indentity:null, 
	},
	  mutations: {
	    setUserInfo(state, userInfo) {
	      state.user = userInfo;
		  uni.setStorageSync('userInfo',userInfo)
	    },
		setIndentity(state, indentity) {
		  state.indentity = indentity;
		}, 
	  }, 
	    getters: {
	      getUserInfo(state) {
	        return  state.user;
	      },
		  getIndentity(state) {
		    return state.indentity;
		  }, 
	    }
})

export default store
